const express = require('express')
const ProjectRouter = express.Router()
const multer = require('multer')
const upload = multer({ dest: 'public/projectuploads/' })

const ProjectController = require('../../controllers/admin/ProjectController.js')

ProjectRouter.post('/adminapi/project/add', upload.single('file'), ProjectController.add)

ProjectRouter.get('/adminapi/project/list', ProjectController.getList)

ProjectRouter.get('/adminapi/project/list/:id', ProjectController.getList)

ProjectRouter.post('/adminapi/project/list', upload.single('file'), ProjectController.updateList)

ProjectRouter.delete('/adminapi/project/list/:id', ProjectController.deleteList)

module.exports = ProjectRouter